/**
********************************************************************************
* @file     sdl_render.h
* @brief    对文件的简要说明
* @details  对文件的详细说明
* @author   jcai
* @date     2024-06-07 20:09:06
* @copyright Copyright &copy; 2024 wy1107412334@163.com All rights reserved
* @version  v0.0.1
*
* \n Email:  wy1107412334@163.com
* \n Blog:   None
* \n Github: https://github.com/wy1107412334
* \n Gitee:  https://gitee.com/git.git1107412334.com
*
********************************************************************************
* @note
* None.
********************************************************************************
* @attention
* None.
********************************************************************************
@verbatim
@endverbatim
********************************************************************************
* @par 历史记录
* jcai, 2024-06-07 20:09:06
* - 首次编写
*
*<center>Copyright &copy; 2024 wy1107412334@163.com All rights reserved</center>
********************************************************************************
*/

#ifndef __SDL_READER_H__
#define __SDL_READER_H__


/* 头文件导入区 ------------------------------------------------------------- */

#include <stdint.h>
#include <SDL2/SDL.h>
#include "signal_link_list.h"


#ifdef __cplusplus
extern "C"
{
#endif

/** @addtogroup SDL_RENDER
* @brief sdl_render modules
* @{
*/


/** @defgroup SDL_RENDER_CompilationDefines sdl_render compilation defines
* @brief 条件编译定义
* @{
*/



/** defgroup SDL_RENDER_CompilationDefines
* @}
*/


/** @defgroup SDL_RENDER_Input_Interface sdl_render Input API Interface
* @brief 模块输入API接口。即对外部少量依赖模块的API接口
* @{
*/



/** defgroup SDL_RENDER_Input_Interface
* @}
*/


/** @defgroup SDL_RENDER_Exported_MacroDefines sdl_render exported macro defines
* @brief 全局宏定义
* @{
*/



/** defgroup SDL_RENDER_Exported_MacroDefines
* @}
*/


/** @defgroup SDL_RENDER_Exported_Types sdl_render exported types
* @brief 全局数据类型声明
* @{
*/

typedef void (*event_cb)(const SDL_Event * e, void * lvglDrv, void * arg);

typedef struct
{
    SDL_EventType   type;
    event_cb        fn;
    void *          arg;
} sdl_event_handle_t;

typedef struct
{
    SL_NODE                 node;
    void *                  lvglDrv;
    sdl_event_handle_t *    arr;
    uint32_t                arrlen;
} sdl_event_handle_arr_t;


/** defgroup SDL_RENDER_Exported_Types
* @}
*/






/* 全局变量声明区 ----------------------------------------------------------- */







/* 全局函数声明区 ----------------------------------------------------------- */

int sdl_init(void);
void sdl_deinit(void);

void * sdl_window_create(const char * title, uint32_t winWidth, uint32_t winHight);
void sdl_window_destroy(void * handle);

int sdl_event_listen(void * handle, sdl_event_handle_arr_t * p);

void sdl_exec(void);

void sdl_draw_point(void * handle, uint32_t x, uint32_t y, uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
void sdl_clear_screen(void * handle);
void sdl_update_screen(void * handle);





/** addtogroup SDL_RENDER
* @}
*/

#ifdef __cplusplus
}
#endif
#endif // __SDL_RENDER_H__


/*********************************** END OF FILE ******************************/
